/**
 *  数据库备份列表
 *
 *  @author   ghh
 *  @version  1.0
 */
require(['baseLayout', 'common'], function (BaseLayout, common) {
    $(function () {
        var baseLayout = new BaseLayout({
            cells: {
                a: {
                    title: "数据备份配置",
                    attachId: 'grid',
                    attachType: 'grid',
                    width: 500,
                    isAttachToolbar: true,
                    toolbarParam: {
                        buttons: {'add': true, 'edit': true, 'del': true}
                    },
                    gridParam: {
                        ajax: {
                            url: 'api/dev/data/backup/config/page/list'
                        },
                        columns: [
                            {display: '数据源表名', name: 'fromTable', width: 220},
                            {display: '数据备份表名', name: 'toTable', width: 220, align: 'left'},
                            {display: '几天备份一次', name: 'backupDays', width: 80},
                            {display: '时间字段', name: 'timeColumn', width: 220, align: 'center'},
                            {display: '上次备份时间', name: 'lastBackupDate', width: 180, align: 'center'},
                            {
                                display: '操作', width: 60, align: 'center',
                                renderItems: {
                                    'edit': true,
                                    'del': {
                                        url: "api/dev/data/backup/config/{id}"
                                    }
                                }
                            }
                        ],
                        showType: 'list',
                        row: {
                            selectIndex: 0,
                            onSelect: function (id) {

                            }
                        }
                    },
                    winParam: {
                        winCallback: 'win_dev_data_backup_config_detail_callback',
                        isCutTitle: true,
                        all: {
                            href: "job/dev/detail.html",
                            area: ["650px", "270px"]
                        },
                        add: {
                            title: '数据备份配置'
                        },
                        edit: {
                            title: '数据备份配置',
                        }
                    }
                }
            }
        });
    })
});
